﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CNTVNow.Web.Helpers.Common;

namespace CNTVNow.Web.Models
{
    public class SportModel
    {
        public List<New> GetNewsTopBanner()
        {
            return (from n in SingletonContext.CntvContext.News where (n.SubPagePositionID == Config.PositionTopBanner()) orderby n.LastModifiedDate descending select n).Take(Config.NewsTopNumber()).ToList();
        }
        public List<New> GetNewsUnderTopBanner()
        {
            return (from n in SingletonContext.CntvContext.News where (n.SubPagePositionID == Config.PositionUnderTopBanner()) orderby n.LastModifiedDate descending select n).Take(Config.NewsUnderTopNumber()).ToList();
        }
        public List<New> GetNewsLatest()
        {
            return (from n in SingletonContext.CntvContext.News where (n.SubPagePositionID == Config.PositionLatestNews()) orderby n.LastModifiedDate descending select n).Take(Config.NewsLatestNumber()).ToList();
        }
        public List<New> GetNewsLeft()
        {
            return (from n in SingletonContext.CntvContext.News where (n.SubPagePositionID == Config.PositionLeftNews()) orderby n.LastModifiedDate descending select n).Take(Config.NewsLeftNumber()).ToList();
        }
        public List<New> GetNewsMiddle()
        {
            return (from n in SingletonContext.CntvContext.News where (n.SubPagePositionID == Config.PositionMiddleNews()) orderby n.LastModifiedDate descending select n).Take(Config.NewsMiddleNumber()).ToList();
        }
    }
}